Apparatus and method for detecting a phase difference

ABSTRACT

A method for detecting a phase difference between a first input signal and a second input signal is provided. The method contains: detecting the phase difference of the first and the second input signals to produce an output signal; generating a first voltage according to a first level of the output signal; generating a second voltage according to a second level of the output signal; and comparing the first voltage and the second voltage to produce the information regarding the phase difference between the first and the second input signals.

BACKGROUND OF INVENTION

1. Field of the Invention

The present invention relates to an apparatus for detecting a phasedifference, and more specifically, to an apparatus for detecting a phasedifference using a charge pump module and a method thereof.

2. Description of the Prior Art

Many types of circuits, such as clock generators or RF transceivers,require a clock signal with highly precise phase. An imprecise phase ofthe clock signal will result in the mistake of the whole system.Generally speaking, the larger the phase error, the larger the jitter ofoutput clock signal(s). Hence, for the systems which need precise clocksignals, the larger phase error may result in a serious error incircuits of the next stages.

Phase differences in circuits can be adjusted when the phase differencescan be detected. However, in some cases, the phase difference is sominute that the conventional phase detector cannot detect the phasedifference between the two input signals.

SUMMARY OF INVENTION

It is therefore one of objectives of the claimed invention to provide anapparatus and a method for detecting a phase difference between twoinput signals when the phase difference is minute.

The other objective of the claimed invention is to provide an apparatusand a method for detecting a phase difference by using a charge pumpmodule.

The other objective of the claimed invention is to provide an apparatusand a method for detecting a phase difference and accumulating the phasedifference.

According to the claimed invention, a method for detecting a phasedifference between a first input signal and a second input signal isdisclosed. The method contains: receiving the first and the second inputsignals and producing an output signal; generating a first voltage and asecond voltage according to the level of the output signal,respectively; and comparing the first voltage and the second voltage toproduce information regarding the phase difference between the first andthe second input signals.

According to the claimed invention, an apparatus for detecting a phasedifference between a first input signal and a second input signal isdisclosed. The apparatus for detecting a phase difference contains adetecting circuit utilized for detecting the first and the second inputsignals and producing an output signal; a charge pump module utilizedfor generating a first voltage and a second voltage according to thelevel of the output signal; and a comparing circuit utilized forcomparing the first voltage and the second voltage to produceinformation regarding the phase difference between the first and thesecond input signals.

These and other objectives of the claimed invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment, which isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a functional diagram of an apparatus for detecting a phasedifference according to one embodiment of the claimed invention.

FIG. 2 is timing diagram of the first input signal A, the second inputsignal B, and the output signal C.

FIG. 3 is a timing diagram showing the output signal C, the firstvoltage V1, and the second voltage V2 during a predetermined number ofcycles PC.

FIG. 4 is a flowchart for detecting a phase difference according to oneembodiment of the claimed invention.

FIG. 5 is a functional diagram of a charge pump module of the embodimentaccording to the claimed invention.

DETAILED DESCRIPTION

An example of the disclosed method and structure of the claimedinvention is given in FIG. 1. FIG. 1 is a functional diagram of anapparatus for detecting a phase difference according to the claimedinvention. The apparatus 200 comprises a detecting circuit 20, a chargepump module 21, and a comparing circuit 22. In the embodiment of theclaimed invention, the input ends of the detecting circuit 20 receive afirst input signal A and a second input signal B. The detecting circuit20 detects a phase difference between the first input signal A and thesecond input signal B and produces an output signal C. In an embodiment,the detecting circuit 20 is implemented using a XOR gate 70. It shouldbe appreciated the detecting circuit 20 of the present invention can beany type of phase detectors and is nor limited to being a XOR gate.

Please refer to FIG. 2. FIG. 2 is a timing diagram of the first inputsignal A, the second input signal B, and the output signal C. The firstinput signal A and the second input signal B in FIG. 2 are two inputsignals having the same frequency but different phases. Of course, thefirst input signal A and the second input signal B can be two inputsignals having the different frequency. The output signal C representsthe phase difference between the first input signal A and the secondinput signal B. In this instance (FIG. 2), since the phase differencebetween the first input signal A and the second input signal B issmaller than 90 degrees, the duty cycle of the output signal C issmaller than 50%. If the phase difference between the first input signalA and the second input signal B is exactly 90 degrees, the duty cycle ofthe output signal C will be exactly 50%. The above-mentioned descriptionis only one embodiment and is not to limit the present invention. Theapparatus and the method according to the claimed invention can, ofcourse, be utilized to detect the phase difference between two inputsignals with different frequencies.

In an embodiment, the charge pump module 21 in FIG. 1 comprises a firstcharge pump 31, a second charge pump 32, and an inverter 35. The firstcharge pump 31 receives the output signal C. The inverter 35 inverts theoutput signal C, and the second charge pump 32 receives the invertedoutput signal C.

In the present embodiment, the first charge pump 31 generates a firstvoltage V1 according to the logical high of the output signal C. Thefirst charge pump 31 comprises the first current source 41, a firstswitch 42, and a first capacitor 43. The first current source 41 isutilized for providing a current I1. The first switch 42 coupled to thefirst current source 41 is turned on or off according to the logicalhigh of the output signal C. The first capacitor 43 coupled to the firstswitch 42 supplies a first voltage V1 from the charge accumulated fromthe current I1 received from the first current source 41. According tothe configuration in FIG. 1, the first switch 42 is controlled accordingto the output signal C. In an embodiment, the first capacitor 43 ischarged within a predetermined number of cycles PC and the first voltageV1 is accumulated; the stored charge is then used to generate the firstvoltage V1.

The second charge pump 32 generates a second voltage V2 according to thelogical low of the output signal C. The second charge pump 32 comprisesthe second current source 51, a second switch 52, and a second capacitor53. The second current source 51 is utilized for providing a current I2.The first switch 52 coupled to the second current source 51 is turned onor off according to the logical low of the output signal C due to thepresence of an inverter 35. The second capacitor 53 coupled to thesecond switch 52 supplies a second voltage V2 from the chargeaccumulated from the current received from the second switch 42.According to the configuration in FIG. 1, the second switch 52 is turnedon or off according to the logical low of the output signal C. In anembodiment, the second capacitor 53 is charged within the predeterminednumber of cycles PC and the second voltage V2 is accumulated; the storedcharge is then used to generate the second voltage V2.

In an embodiment, the first charge pump 31 and second charge pump 32 arecoupled to the first current source 41. By using only one current sourcefor both charge pumps, errors resulting from differences between thefirst current source 41 and the second current source 51 can be avoided.

Please refer to FIG. 3. FIG. 3 is a timing diagram showing the outputsignal C, the first voltage V1, and the second voltage V2 during thepredetermined number of cycles PC. It can be clearly shown in FIG. 3that the larger the number of the predetermined number of cycles PC, thebigger the difference between the first voltage V1 and the secondvoltage V2. In other words, the difference between the two voltages areexaggerated with the passage of more charging cycles. Therefore theduration of the predetermined number of cycles PC is determined by theneeded precision required from the present invention. The bigger thepredetermined number of the predetermined number of cycles PC, the moreobvious the difference between the first voltage V1 and the secondvoltage V2, which represents the phase difference, and the higher theprecision of the detected phase difference.

Please refer to FIG. 1 again. The first voltage V1 and the secondvoltage V2 received by the input ends of the comparing circuit 22 inFIG. 1 are compared in order to produce information regarding the phasedifference between the first input signal A and the second input signalB. The information regarding the phase difference is then output by theoutput end of the comparing circuit 22. In an embodiment, the comparingcircuit 22 can be implemented using a one-bit comparator. The apparatusof the present invention can know the phase difference according to theoutput signal from the one-bit comparator and the predetermined numberof cycles PC. The output signal of the one-bit comparator can representthat the first input signal A leads or lags the second input signal B.In the other embodiment, the comparing circuit 22 can also beimplemented using an analog to digital converter (ADC). A digital valueoutputted by the ADC can represent the phase difference between thefirst input signal A and the second input signal B.

FIG. 4 is a flowchart for detecting a phase difference shown in FIG. 1according to the claimed invention. The flow comprises the followingsteps:

Step 200: Start;

Step 202: A detecting circuit 20 receives a first input signal A and asecond input signal B and produces an output signal C;

Step 204: Generate a first voltage V1 according to the logical high ofthe output signal C;

Step 206: Generate a second voltage V2 according to the logical low ofthe output signal C;

Step 208: Compare the first voltage V1 and the second voltage V2 toproduce information regarding the phase difference between the first andthe second input signals A, B;

Step 210: End.

Ideally, the first charge pump 31 and the second charge pump 32 shouldfunction in exactly the same manner, providing the same results for thesame signal. In application, however, there may be some discrepanciesbetween the first charge pump 31 and the second charge pump 32 due toprocess mismatches or other reasons i.e. each pump produce slightlydifferent results when given the same signal. To reduce theabove-mentioned effects, in an embodiment, a switch circuit 83 is usedto change the coupling relationship between the input signals A, B andthe charge pumps 31, 32. By using the above-mentioned switching actionand followed by numerical operations on the results of the phasedifference detection, the possibly above-mentioned effects can bereduced to the lowest level to get more precise results from the phasedifference detection.

FIG. 5 is a functional diagram of a charge pump module 81 according tothe claimed invention. The charge pump module 81 in FIG. 5 can beutilized for replacing the charge pump module 21 in FIG. 1. The chargepump module 81 comprises a first charge pump 31, a second charge pump 32and a switch circuit 83. The switch circuit 83 contains two input ends,two output ends, a third switch 84 and a fourth switch 85. The thirdswitch 84 and the fourth switch 85 are controlled by a control signalCTRL. The switch circuit 83 is coupled between the output signal C, theinverted output signal C, the first charge pump 31 and the second chargepump 32. After a predetermined period, the switch circuit 83 is utilizedfor changing the coupling relationship between the output signals(output signal C, the inverted output signal C) and the charge pumps(first charge pump 31 and the second charge pump 32) using the controlsignal CTRL.

For example, firstly, the first charge pump 31 will charge the firstcapacitor 43 according to the logical high of the output signal C andgenerate a first voltage V1 (same as the V1 in FIG. 1). The secondcharge pump 32 will charge the second capacitor 53 according to thelogical low of the output signal C and generate a second voltage V2(same as the V2 in FIG. 1). Then the comparing circuit 22 compares thefirst voltage V1 and the second voltage V2 to produce first information.The switching action occurs after the predetermined number of cycles PC,the first charge pump 31 will charge the first capacitor 43 according tothe logical low of the output signal C and generate a third voltage V3.The second charge pump 32 will charge the second capacitor 53 accordingto the logical high of the output signal C and generate a fourth voltageV4. Then the comparing circuit 22 compares the third voltages V3 and thefourth voltages V4 is to produce second information regarding the phasedifference between the first input signal A and the second input signalB. Therefore, by combining the first information regarding the phasedifference corresponding to the first voltage V1 and the second voltageV2 and the second information regarding the phase differencecorresponding to the third voltage V3 and the fourth voltage V4, moreprecise phase difference is obtained.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device may be made while retainingthe teachings of the invention. Accordingly, the above disclosure shouldbe construed as limited only by the metes and bounds of the appendedclaims.

1. A method for detecting a phase difference between a first inputsignal and a second input signal, comprising: receiving the first andthe second input signals and outputting a phase difference signal of thefirst and the second input signals; generating a first voltage and asecond voltage according to the level of the phase difference signal;and comparing the first voltage and the second voltage to produce acomparison value that represents the phase difference between the firstand the second input signals.
 2. The method of claim 1, furthercomprising: processing a XOR operation on the first and the second inputsignals to output the phase difference signal.
 3. The method of claim 1,further comprising: accumulating the first voltage and the secondvoltage, respectively.
 4. The method of claim 1, wherein the step ofgenerating the first and second voltages comprises: generating a firstvoltage and a second voltage according to the first and the secondlevels of the phase difference signal, respectively.
 5. The method ofclaim 1, wherein the step of generating the first and second voltagescomprises: in a first period, generating the first voltage and thesecond voltage according to the first and the second levels of the phasedifference signal, respectively; and in a second period, generating thefirst voltage and the second voltage according to the second and thefirst levels of the phase difference signal, respectively.
 6. The methodof claim 1, wherein the step of generating the first and second voltagescomprises: providing the first and the second currents according to thefirst and the second levels of the phase difference signal,respectively; generating the first and the second voltages according tothe first and the second currents.
 7. The method of claim 6, wherein thestep of generating the first and second voltages further comprises:providing the first and the second currents according to the second andthe first levels of the phase difference signal, respectively.
 8. Anapparatus for detecting a phase difference between a first input signaland a second input signal, comprising: a detecting circuit utilized forreceiving the first and the second input signals to output a phasedifference signal; a charge pump module utilized for respectivelygenerating a first voltage and a second voltage according to the levelof the phase difference signal; and a comparing circuit utilized forcomparing the first voltage and the second voltage to produce acomparison signal that represents the phase difference between the firstand the second input signals.
 9. The apparatus of claim 8, wherein thedetecting circuit is a XOR gate.
 10. The apparatus of claim 8, whereinthe charge pump module accumulates the first voltage and the secondvoltage, respectively.
 11. The apparatus of claim 8, wherein the chargepump module comprises a first charge pump and a second charge pump. 12.The apparatus of claim 11, wherein the first charge pump comprises: afirst current source utilized for providing a first current; a firstcapacitor charged by receiving the first current and utilized forgenerating the first voltage; and a first switch, coupled between thefirst current source and the first capacitor, for controlling thecharging of the first capacitor according to the first level of thephase difference signal.
 13. The apparatus of claim 8, wherein thecharge pump module comprises: a first current source utilized forproviding a first current; a first capacitor charged by receiving thefirst current and utilized for generating the first voltage; a firstswitch, coupled between the first current source and the firstcapacitor, for controlling the charging of the first capacitor accordingto the first level of the phase difference signal; a second capacitorcharged by receiving the first current and utilized for generating thesecond voltage; and a first switch, coupled between the first currentsource and the second capacitor, for controlling the charging of thesecond capacitor according to the second level of the phase differencesignal.
 14. The apparatus of claim 8, further comprising: a switchcircuit, coupled between the detecting circuit and the charge pumpmodule, for changing the coupling relationship between the phasedifference signal and the charge pump module.
 15. The apparatus of claim8, wherein the comparing circuit is a one-bit comparator.
 16. Theapparatus of claim 8, wherein the comparing circuit is an analog todigital converter (ADC).
 17. A method for detecting a phase differencebetween a first input signal and a second input signal, comprising:receiving the first and the second input signals and outputting a phasedifference signal of the first and the second input signals; generatinga first voltage according to a first level of the phase differencesignal; and generating a second voltage according to a second level ofthe phase difference signal; and comparing the first voltage and thesecond voltage to produce a comparison value that represents the phasedifference.
 18. The method of claim 17, further comprising: accumulatingthe first voltage and the second voltage, respectively.